﻿import React, { Component } from 'react'
import MySecondListView from '../../components/my_listview/my_second_listview'
import {connect} from 'react-redux'
import {queryAllNewsByTypeAsync} from '../../redux/actions'

class NewsList extends Component {
  constructor(props){
    super(props)
  }

  componentDidMount(){
    
  }

  render() {
    const type = this.props.match.params.type
    return (
      <div className="content_margin">
        <MySecondListView dataSource={this.props.dataSource} appendList={this.props.queryAllNewsByTypeAsync} type={type}/>
      </div>
    );
  }
}

export default connect(
  state=>({dataSource:state.newsListData.datasource}),
  {queryAllNewsByTypeAsync})(NewsList)